// These schemas are designed for jsonv2 package

package en

type AltOf struct {
	Word  string  `json:"word"`
	Extra *string `json:"extra,omitempty"`
}

type LinkageData struct {
	Alt         *string    `json:"alt,omitempty"`
	English     *string    `json:"english,omitempty"` // DEPRECATED in favor of "translation"
	Translation *string    `json:"translation,omitempty"`
	Extra       *string    `json:"extra,omitempty"`
	Qualifier   *string    `json:"qualifier,omitempty"`
	RawTags     []string   `json:"raw_tags,omitempty"`
	Roman       *string    `json:"roman,omitempty"`
	Ruby        [][]string `json:"ruby,omitempty"`
	Sense       *string    `json:"sense,omitempty"`
	Source      *string    `json:"source,omitempty"`
	Tags        []string   `json:"tags,omitempty"`
	Taxonomic   *string    `json:"taxonomic,omitempty"`
	Topics      []string   `json:"topics,omitempty"`
	URLs        []string   `json:"urls,omitempty"`
	Word        *string    `json:"word,omitempty" w2s:"INDEX"`
}

type ExampleData struct {
	English                *string    `json:"english,omitempty"` // DEPRECATED in favor of "translation"
	Translation            *string    `json:"translation,omitempty"`
	BoldTranslationOffsets [][2]int   `json:"bold_translation_offsets,omitempty"`
	Note                   *string    `json:"note,omitempty"`
	Ref                    *string    `json:"ref,omitempty"`
	Roman                  *string    `json:"roman,omitempty"`
	BoldRomanOffsets       [][2]int   `json:"bold_roman_offsets,omitempty"`
	Ruby                   [][]string `json:"ruby,omitempty"`
	Text                   *string    `json:"text,omitempty"`
	BoldTextOffsets        [][2]int   `json:"bold_text_offsets,omitempty"`
	Type                   *string    `json:"type,omitempty"`
	LiteralMeaning         *string    `json:"literal_meaning,omitempty"`
	BoldLiteralOffsets     [][2]int   `json:"bold_literal_offsets,omitempty"`
	Tags                   []string   `json:"tags,omitempty"`
	RawTags                []string   `json:"raw_tags,omitempty"`
}

type FormOf struct {
	Word  string  `json:"word"`
	Extra *string `json:"extra,omitempty"`
	Roman *string `json:"roman,omitempty"`
}

type LinkData []string

type PlusObjTemplateData struct {
	Tags    []string `json:"tags,omitempty"`
	Words   []string `json:"words,omitempty"`
	Meaning *string  `json:"meaning,omitempty"`
}

type ExtraTemplateData PlusObjTemplateData

type TemplateData struct {
	Args      map[string]string  `json:"args,omitempty"`
	Expansion *string            `json:"expansion,omitempty"`
	Name      string             `json:"name"`
	ExtraData *ExtraTemplateData `json:"extra_data,omitempty"`
}

type DescendantData struct {
	LangCode    *string          `json:"lang_code,omitempty" w2s:"INDEX"`
	Lang        *string          `json:"lang,omitempty"`
	Word        *string          `json:"word,omitempty"`
	Roman       *string          `json:"roman,omitempty"`
	Tags        []string         `json:"tags,omitempty"`
	RawTags     []string         `json:"raw_tags,omitempty"`
	Descendants []DescendantData `json:"descendants,omitempty"`
	Ruby        [][]string       `json:"ruby,omitempty"`
	Sense       *string          `json:"sense,omitempty"`
}

type FormData struct {
	Form    *string    `json:"form,omitempty"`
	HeadNr  *int       `json:"head_nr,omitempty"`
	Ipa     *string    `json:"ipa,omitempty"`
	Roman   *string    `json:"roman,omitempty"`
	Ruby    [][]string `json:"ruby,omitempty"`
	Source  *string    `json:"source,omitempty"`
	Tags    []string   `json:"tags,omitempty"`
	RawTags []string   `json:"raw_tags,omitempty"`
	Topics  []string   `json:"topics,omitempty"`
}

type Hyphenation struct {
	Parts []string `json:"parts,omitempty"`
	Tags  []string `json:"tags,omitempty"`
}

type SoundData struct {
	Audio     *string  `json:"audio,omitempty"`
	AudioIPa  *string  `json:"audio-ipa,omitempty"`
	Enpr      *string  `json:"enpr,omitempty"`
	Form      *string  `json:"form,omitempty"`
	Hangeul   *string  `json:"hangeul,omitempty"`
	Homophone *string  `json:"homophone,omitempty"`
	Ipa       *string  `json:"ipa,omitempty"`
	Mp3URL    *string  `json:"mp3_url,omitempty"`
	Note      *string  `json:"note,omitempty"`
	OggURL    *string  `json:"ogg_url,omitempty"`
	Other     *string  `json:"other,omitempty"`
	Rhymes    *string  `json:"rhymes,omitempty"`
	Tags      []string `json:"tags,omitempty"`
	Text      *string  `json:"text,omitempty"`
	Topics    []string `json:"topics,omitempty"`
	ZhPron    *string  `json:"zh-pron,omitempty"`
}

type TranslationData struct {
	Alt         *string  `json:"alt,omitempty"`
	LangCode    *string  `json:"lang_code,omitempty" w2s:"INDEX"`
	Code        *string  `json:"code,omitempty"`    // DEPRECATED in favor of lang_code
	English     *string  `json:"english,omitempty"` // DEPRECATED in favor of "translation"
	Translation *string  `json:"translation,omitempty"`
	Lang        *string  `json:"lang,omitempty"`
	Note        *string  `json:"note,omitempty"`
	Roman       *string  `json:"roman,omitempty"`
	Sense       *string  `json:"sense,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Taxonomic   *string  `json:"taxonomic,omitempty"`
	Topics      []string `json:"topics,omitempty"`
	Word        *string  `json:"word,omitempty"`
}

// Xxyzz's East Asian etymology example data
type EtymologyExample struct {
	English     *string  `json:"english,omitempty"` // DEPRECATED in favor of "translation"
	Translation *string  `json:"translation,omitempty"`
	RawTags     []string `json:"raw_tags,omitempty"`
	Ref         *string  `json:"ref,omitempty"`
	Roman       *string  `json:"roman,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Text        *string  `json:"text,omitempty"`
	Type        *string  `json:"type,omitempty"`
}

type ReferenceData struct {
	Text *string `json:"text,omitempty"`
	Refn *string `json:"refn,omitempty"`
}

type AttestationData struct {
	Date       *string         `json:"date,omitempty"`
	References []ReferenceData `json:"references,omitempty"`
}

type SenseData struct {
	AltOf           []AltOf           `json:"alt_of,omitempty"`
	Antonyms        []LinkageData     `json:"antonyms,omitempty"`
	Categories      []string          `json:"categories,omitempty"`
	CompoundOf      []AltOf           `json:"compound_of,omitempty"`
	CoordinateTerms []LinkageData     `json:"coordinate_terms,omitempty"`
	Examples        []ExampleData     `json:"examples,omitempty"`
	FormOf          []FormOf          `json:"form_of,omitempty"`
	Glosses         []string          `json:"glosses,omitempty"`
	HeadNr          *int              `json:"head_nr,omitempty"`
	Holonyms        []LinkageData     `json:"holonyms,omitempty"`
	Hypernyms       []LinkageData     `json:"hypernyms,omitempty"`
	Hyponyms        []LinkageData     `json:"hyponyms,omitempty"`
	Instances       []LinkageData     `json:"instances,omitempty"`
	Links           []LinkData        `json:"links,omitempty"`
	Meronyms        []LinkageData     `json:"meronyms,omitempty"`
	Qualifier       *string           `json:"qualifier,omitempty"`
	RawGlosses      []string          `json:"raw_glosses,omitempty"`
	Related         []LinkageData     `json:"related,omitempty"` // also used for "alternative forms"
	Senseid         []string          `json:"senseid,omitempty"`
	Synonyms        []LinkageData     `json:"synonyms,omitempty"`
	Tags            []string          `json:"tags,omitempty"`
	Taxonomic       *string           `json:"taxonomic,omitempty"`
	Topics          []string          `json:"topics,omitempty"`
	Wikidata        []string          `json:"wikidata,omitempty"`
	Wikipedia       []string          `json:"wikipedia,omitempty"`
	Attestations    []AttestationData `json:"attestations,omitempty"`
}

type WordData struct {
	Abbreviation        *string            `json:"abbreviation,omitempty"`
	Abbreviations       []LinkageData      `json:"abbreviations,omitempty"`
	AltOf               []AltOf            `json:"alt_of,omitempty"`
	Antonyms            []LinkageData      `json:"antonyms,omitempty"`
	Categories          []string           `json:"categories,omitempty"`
	CoordinateTerms     []LinkageData      `json:"coordinate_terms,omitempty"`
	Derived             []LinkageData      `json:"derived,omitempty"`
	Descendants         []DescendantData   `json:"descendants,omitempty"`
	EtymologyExamples   []EtymologyExample `json:"etymology_examples,omitempty"`
	EtymologyNumber     *int               `json:"etymology_number,omitempty"`
	EtymologyTemplates  []TemplateData     `json:"etymology_templates,omitempty"`
	EtymologyText       *string            `json:"etymology_text,omitempty"`
	FormOf              []FormOf           `json:"form_of,omitempty"`
	Forms               []FormData         `json:"forms,omitempty"`
	HeadTemplates       []TemplateData     `json:"head_templates,omitempty"`
	Holonyms            []LinkageData      `json:"holonyms,omitempty"`
	Hyphenation         []string           `json:"hyphenation,omitempty"` // being deprecated
	Hyphenations        []Hyphenation      `json:"hyphenations,omitempty"`
	Hypernyms           []LinkageData      `json:"hypernyms,omitempty"`
	Hyponyms            []LinkageData      `json:"hyponyms,omitempty"`
	InflectionTemplates []TemplateData     `json:"inflection_templates,omitempty"`
	InfoTemplates       []TemplateData     `json:"info_templates,omitempty"`
	Instances           []LinkageData      `json:"instances,omitempty"`
	Lang                string             `json:"lang" w2s:"INDEX"`
	LangCode            string             `json:"lang_code" w2s:"INDEX"`
	LiteralMeaning      *string            `json:"literal_meaning,omitempty"`
	Meronyms            []LinkageData      `json:"meronyms,omitempty"`
	OriginalTitle       *string            `json:"original_title,omitempty"`
	Pos                 *string            `json:"pos,omitempty"`
	Proverbs            []LinkageData      `json:"proverbs,omitempty"`
	Redirects           []string           `json:"redirects,omitempty"`
	Related             []LinkageData      `json:"related,omitempty"`
	Senses              []SenseData        `json:"senses,omitempty"`
	Sounds              []SoundData        `json:"sounds,omitempty"`
	Synonyms            []LinkageData      `json:"synonyms,omitempty"`
	Translations        []TranslationData  `json:"translations,omitempty"`
	Troponyms           []LinkageData      `json:"troponyms,omitempty"`
	Wikidata            []string           `json:"wikidata,omitempty"`
	Wikipedia           []string           `json:"wikipedia,omitempty"`
	Word                string             `json:"word" w2s:"NOT NULL,INDEX"`
	Anagrams            []LinkageData      `json:"anagrams,omitempty"`
}
